Reduce PowerShell Lambda INIT time by omitting unwanted files from pa…#2358
Open
sankettangade wants to merge 2 commits intodevfrom
Open
Reduce PowerShell Lambda INIT time by omitting unwanted files from pa…#2358sankettangade wants to merge 2 commits intodevfrom
sankettangade wants to merge 2 commits intodevfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of changes:
New-AWSPowerShellLambdaPackagenow strips files that have no purpose at Lambda runtime from AWS-authored PowerShell modules during packaging:*.xml(PowerShell help XML, .NET XMLDoc, PowerShellGet metadata) and*.pdb(debug symbols).AWSPowerShell.NetCoreandAWS.Tools.*modules under the package'sModules/directory. Third-party PowerShell modules are not touched.Measured Impact
Cold-start INIT measured against a matched-runtime baseline (
dotnet10,Microsoft.PowerShell.SDK 7.5.4, 512 MB, us-east-1, 100 cold starts each).AWS.Tools.EC2 example (largest module tested):
EC2 also showed a notable tail-latency improvement: P99 dropped from 4697.8 ms → 2954.4 ms on x86_64 (−1.7s).
Across services, the improvement scales with bytes stripped per module, averaging ~5% INIT reduction on chunky modules. All users of
New-AWSPowerShellLambdaPackagebenefit automatically with no script or invocation changes.Test Plan
Invoke-Pester PowerShell/Tests/)Module load failedorCannot finderrors in CloudWatch logsBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.